// @ts-ignore
import { api } from '@/utils/api';

/** 新增数据权限模板信息数据 POST /dataPermissionTemplate/add */
export async function dataPermissionTemplateAdd(
  body: BASE.DataPermissionTemplate,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResult>;

export async function dataPermissionTemplateAdd(
  body: BASE.DataPermissionTemplate,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResult>>;

export async function dataPermissionTemplateAdd(
  body: BASE.DataPermissionTemplate,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResult>;

export async function dataPermissionTemplateAdd(
  body: BASE.DataPermissionTemplate,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResult>(`/app/dataPermissionTemplate/add`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResult>(`/app/dataPermissionTemplate/add`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 删除数据权限模板信息数据 POST /dataPermissionTemplate/delete */
export async function dataPermissionTemplateDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResult>;

export async function dataPermissionTemplateDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResult>>;

export async function dataPermissionTemplateDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResult>;

export async function dataPermissionTemplateDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResult>(`/app/dataPermissionTemplate/delete`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResult>(`/app/dataPermissionTemplate/delete`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 获取数据权限模板信息数据 POST /dataPermissionTemplate/get */
export async function dataPermissionTemplateGet(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultDataPermissionTemplate>;

export async function dataPermissionTemplateGet(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultDataPermissionTemplate>>;

export async function dataPermissionTemplateGet(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultDataPermissionTemplate>;

export async function dataPermissionTemplateGet(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultDataPermissionTemplate>(`/app/dataPermissionTemplate/get`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultDataPermissionTemplate>(`/app/dataPermissionTemplate/get`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 获取数据权限模板信息分页数据 POST /dataPermissionTemplate/page */
export async function dataPermissionTemplatePage(
  body: BASE.DataPermissionTemplateQuery,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultIPageDataPermissionTemplate>;

export async function dataPermissionTemplatePage(
  body: BASE.DataPermissionTemplateQuery,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultIPageDataPermissionTemplate>>;

export async function dataPermissionTemplatePage(
  body: BASE.DataPermissionTemplateQuery,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultIPageDataPermissionTemplate>;

export async function dataPermissionTemplatePage(
  body: BASE.DataPermissionTemplateQuery,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultIPageDataPermissionTemplate>(`/app/dataPermissionTemplate/page`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultIPageDataPermissionTemplate>(`/app/dataPermissionTemplate/page`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 更新数据权限模板信息数据 POST /dataPermissionTemplate/update */
export async function dataPermissionTemplateUpdate(
  body: BASE.DataPermissionTemplate,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResult>;

export async function dataPermissionTemplateUpdate(
  body: BASE.DataPermissionTemplate,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResult>>;

export async function dataPermissionTemplateUpdate(
  body: BASE.DataPermissionTemplate,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResult>;

export async function dataPermissionTemplateUpdate(
  body: BASE.DataPermissionTemplate,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResult>(`/app/dataPermissionTemplate/update`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResult>(`/app/dataPermissionTemplate/update`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}
